let rightCk = document.querySelector('.xtx-checkbox i')
rightCk.addEventListener('click', function () {
  console.log('haha')
  if (rightCk.classList.contains('icon-unchecked')) {
    rightCk.classList.toggle('icon-checked')
  } else {
    rightCk.classList.toggle('icon-unchecked')
  }
})

let inp_user = document.querySelector('.user')
let inp_pwd = document.querySelector('.pwd')
let btn = document.querySelector('.btn')
console.log(btn);
const user_info = localStorage.getItem('uname') || ''
const user_pwd = localStorage.getItem('password') || ''

if (user_info) {
  inp_user.value = user_info
}
if (user_pwd) {
  inp_pwd.value = user_pwd
}
btn.addEventListener('click', function (e) {
  e.preventDefault()
  // 账号
  let valuser = inp_user.value;
  console.log(valuser)
  localStorage.setItem('uname', valuser)
  // 密码
  let valpwd = inp_pwd.value;
  localStorage.setItem('password', valpwd)

  window.location.href = "index2.html"
})



